﻿{% extends 'base.html' %}

{% block stylesheets %}
	{{ block.super }}
	<link rel="stylesheet" content="text/css" href="/static/css/test.view_test.css" />
{% endblock %}

{% comment %}
Block for adding additional buttons to the left of the 'edit page'-button {% endcomment %}
{% block page_buttons %}
{% endblock %}

{% block content %}
		<!-- Questions -->
	<form id="question-form" class="form-inline" method="POST" action="#">
		{% csrf_token %}
		<legend>Questions</legend>
			{% if questions %}
				{% for question in questions %}
					{% load question_extras %}
					{% show_question question %}
				{% endfor %}
			{% else %}
					<p>No questions have been added to this diagnostic test yet.</p>
			{% endif %}
			<hr />
			{% if user.is_staff and not request.session.viewing_as_student %}
				<a href="{% url 'test.views.filter_questions' page_id=page.id %}" class="btn" type="button"><i class="icon-plus"></i> Add questions to existing Diagnostic test</a>
			{% endif %}
		<div id="result" class="alert alert-info"></div>
		
		<!-- Action buttons -->
		{% if user.is_staff and not request.session.viewing_as_student %}
			<button id="submit" class="btn btn-primary"><i class="icon-plus icon-white"></i> Add another question</button>
		{% else %}
			<button id="submit" class="btn btn-primary">Correct my answers</button>
			<button id="my_progess" class="btn btn-primary" action="/book/my_progress/">View my progress</button>
		{% endif %}
	</form> 
{% endblock %}

{% block page_footer %}
	{{ block.super }}
{% endblock %}

{% block scripts %}
	{{ block.super }}
	<!--<script type="text/javascript" src="/static/script/setup_ajax.js"></script>-->
	<script type="text/javascript" src="/static/script/test.view_test.js"></script>
{% endblock %}